package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementBgpBgplsMapper;
import com.ruoyi.net.domain.ElementBgpBgpls;
import com.ruoyi.net.service.IElementBgpBgplsService;

/**
 * 网元-BGP协议-BGPLS地址族配置Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementBgpBgplsServiceImpl implements IElementBgpBgplsService 
{
    @Autowired
    private ElementBgpBgplsMapper elementBgpBgplsMapper;

    /**
     * 查询网元-BGP协议-BGPLS地址族配置
     * 
     * @param id 网元-BGP协议-BGPLS地址族配置主键
     * @return 网元-BGP协议-BGPLS地址族配置
     */
    @Override
    public ElementBgpBgpls selectElementBgpBgplsById(String id)
    {
        return elementBgpBgplsMapper.selectElementBgpBgplsById(id);
    }

    /**
     * 查询网元-BGP协议-BGPLS地址族配置列表
     * 
     * @param elementBgpBgpls 网元-BGP协议-BGPLS地址族配置
     * @return 网元-BGP协议-BGPLS地址族配置
     */
    @Override
    public List<ElementBgpBgpls> selectElementBgpBgplsList(ElementBgpBgpls elementBgpBgpls)
    {
        return elementBgpBgplsMapper.selectElementBgpBgplsList(elementBgpBgpls);
    }

    /**
     * 新增网元-BGP协议-BGPLS地址族配置
     * 
     * @param elementBgpBgpls 网元-BGP协议-BGPLS地址族配置
     * @return 结果
     */
    @Override
    public int insertElementBgpBgpls(ElementBgpBgpls elementBgpBgpls)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBgpBgpls.getId())) {
            elementBgpBgpls.setId(uuid);
        }
        elementBgpBgpls.setCreateBy(SecurityUtils.getUsername());
        elementBgpBgpls.setCreateTime(DateUtils.getNowDate());
        elementBgpBgpls.setUpdateBy(SecurityUtils.getUsername());
        elementBgpBgpls.setUpdateTime(DateUtils.getNowDate());
        return elementBgpBgplsMapper.insertElementBgpBgpls(elementBgpBgpls);
    }

    /**
     * 修改网元-BGP协议-BGPLS地址族配置
     * 
     * @param elementBgpBgpls 网元-BGP协议-BGPLS地址族配置
     * @return 结果
     */
    @Override
    public int updateElementBgpBgpls(ElementBgpBgpls elementBgpBgpls)
    {
        elementBgpBgpls.setUpdateBy(SecurityUtils.getUsername());
        elementBgpBgpls.setUpdateTime(DateUtils.getNowDate());
        return elementBgpBgplsMapper.updateElementBgpBgpls(elementBgpBgpls);
    }

    /**
     * 批量删除网元-BGP协议-BGPLS地址族配置
     * 
     * @param ids 需要删除的网元-BGP协议-BGPLS地址族配置主键
     * @return 结果
     */
    @Override
    public int deleteElementBgpBgplsByIds(String[] ids)
    {
        return elementBgpBgplsMapper.deleteElementBgpBgplsByIds(ids);
    }

    /**
     * 删除网元-BGP协议-BGPLS地址族配置信息
     * 
     * @param id 网元-BGP协议-BGPLS地址族配置主键
     * @return 结果
     */
    @Override
    public int deleteElementBgpBgplsById(String id)
    {
        return elementBgpBgplsMapper.deleteElementBgpBgplsById(id);
    }
}
